<html>
    <head>
        <title>{$title|default:"no title"}</title>

        {assign var='arrcity' value='"ALL",'}

        {foreach item=city from=$cities}
            {$arrcity=$arrcity|cat:'"'|cat:$city.cityname|cat:'",'}
        {/foreach}
        {$arrcity = $arrcity|substr:0:($arrcity|strlen-1)}
        {literal}
            <link href="css/fontstyle.css" rel="stylesheet" type="text/css" charset="utf-8" />
            <link href="css/style.css" rel="stylesheet" type="text/css" />
            <link href="css/jqx.base.css" rel="stylesheet" type="text/css" />
            <link href="css/jpaginate.css" rel="stylesheet" type="text/css" />
            <link href="css/partnercss.css" rel="stylesheet" type="text/css" />

            <script type="text/javascript" src="js/gettheme.js"></script>
            <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
            <script type="text/javascript" src="js/jqxcore.js"></script>
            <script type="text/javascript" src="js/jqxbuttons.js"></script>
            <script type="text/javascript" src="js/jqxscrollbar.js"></script>
            <script type="text/javascript" src="js/jqxlistbox.js"></script>
            <script type="text/javascript" src="js/jqxdropdownlist.js"></script>

            <script type="text/javascript" src="js/jquery-ui.js"></script>


            <link href="css/easyui.css" rel="stylesheet" type="text/css" />
            <link href="css/icon.css" rel="stylesheet" type="text/css" />


            <script type="text/javascript" src="js/jquery.easyui.min.js"></script>
            <script type="text/javascript" src="js/popup.js"></script>
            <script type="text/javascript" src="js/jPaginate.js"></script>

            <script type="text/javascript">
                var _gaq = _gaq || [];
                _gaq.push(['_setAccount', 'UA-33771657-1']);
                _gaq.push(['_trackPageview']);

                (function() {
                    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
                })();
            </script>

            <script language="javascript" type="text/javascript">
                $(document).ready(function () {
                    //initpage();
                
                    var theme = getTheme();
                    var source =[{/literal}{$arrcity}{literal}];// ["Special Offer","Lower Price","Alphabet"];
                    // Create a jqxDropDownList
                    $("#cbopartnersort").jqxDropDownList({ source: source, selectedIndex: 0, autoDropDownHeight: true, width: '180', height: '25', theme: theme });
                    $("#cbopartnersort").bind('select', function (event) {
                        var args = event.args;
                        getpartners(args.index);
                    });
                });
                    
                function getpartners(idx, pageno) {
                    initpage();
                  
                    var category = '';
                    var item = $("#cbopartnersort").jqxDropDownList('getSelectedItem');
                    $("#loading").show();
                    jQuery.ajax({
                        url: 'getpartners.php',
                        data: {
                            'selectedcity'        : item.label
                        },
                        type: 'post',
                        beforeSend: function() {
                            $("#loading").show();
                            $("#partnerlist").html('');
                            $(".pagination").remove();
                        },
                        success: function(json) {
                            $("#partnerlist").html(json);
                            /* pagination */
                            $(".pagination").remove();
                            $("#partnerlist").jPaginate({elementtag: 'span', items: 5, minimize: true});
                            /* end pagination */
                        },
                        complete: function(){
                            $("#loading").hide();
                        },
                        error: function(error) {
                            $("img#busy").hide();
                            $("button#check").show();
                            alert("Some problems have occured. Please try again later: " + error);
                        }
                    })
                }
                
                $("#loading")
                .ajaxStart(function(){
                    $(this).show();
                })
                .ajaxComplete(function(){
                    $(this).hide();
                });
            </script>
        {/literal}
    </head>
    <body id="partners" onload="getpartners(0,1);">
        {include file='header.tpl'}
        
        {include file='sidebar.tpl'}

        <div id="container">
            <table border="0" width="100%" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="25%" valign="top">
                        <div id="leftframetitle">
                            <span class="red_color">OUR</span><span class="black_color">PARTNERS</span>
                        </div>
                    </td>
                    <td>
                        <div id="rightframecontent">
                            <!-- triangle navigator -->
                            <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="50%" class="gradientpartnermenu_sm" align="left">
                                        <div class="partnermenulabel">Please Book from Our Agency Partners.</div>
                                    </td>
                                    <td width="40%" class="gradientcatmenuyellow" align="left">
                                        <div class="partnersortlabel">Sort by</div>
                                        <div id='cbopartnersort' class='partnersortcombo'></div>
                                    </td>
                                    <td width="1%">&nbsp;</td>
                                </tr>

                                <tr>                                    
                                    <td align="center">
                                        <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="45%">
                                                    <div class="triangle-topleft" id="triangle_left"></div>
                                                </td>

                                                <td>
                                                    <div class="triangle-down" id="individual_triangle"></div>
                                                </td> 
                                            </tr>
                                        </table>
                                    </td>
                                    <td align="right">
                                        <div class="triangle-topright" id="triangle_right"></div>
                                    </td>
                                    <td width="1%">&nbsp;</td>
                                </tr>
                            </table>

                            <div id='partnerlist'></div>
                            
                            <center>
                                <img id="loading" src="images/loader_big.gif" style="display:none;" />
                            </center>
                        </div>


                    </td>
                </tr>
            </table>



            <div id="footer-spacer"></div>
        </div>

        {include file='footer.tpl'}

    </body>
</html>